﻿<?php

include ('\lang\rus.php');
function getOnline() {

$q = mysql_query("SELECT id, name, race, exp, player_class, world_id FROM players WHERE online='1' ");
while($row = mysql_fetch_array($q))
{

$data["name"][]=$row["name"];
$data["race"][]=getRace($row["race"]);
$data["lvl"][]=getLevel($row["exp"]);
$data["class"][]=getClass($row["player_class"]);
$data["legion"][]=getLegion($row["id"]);
$data["location"][]=getLocation($row["world_id"]);
} 
mysql_free_result($q);
return @$data;
}

?>
<table width='95%' border='0' cellpadding='0' cellspacing='0' bordercolor='#6b6b6b'>
 <tr align='center'>
  <td><font size='3'><b>#</b></font></td>
  <td><font size='3'><b><?php print $name;?></b></font></td>
  <td><font size='3'><b><?php print $race;?></b></font></td>
  <td><font size='3'><b><?php print $level;?></b></font></td>
  <td><font size='3'><b><?php print $class;?></b></font></td>
  <td><font size='3'><b><?php print $legion;?></b></font></td>
  <td><font size='3'><b><?php print $location;?></b></font></td>
 </tr>
<?php 
$data=getOnline();
$count_online=count($data["name"]);
for ($i=0;count($data["name"])>$i;$i++) {
?>
 <tr align='black'>
  <td>
   <font color='black' size='2'><?php echo ($i+1);?></font>
  </td>
  <td>
   <font color='black' size='2'><?php echo $data["name"][$i];?></font>
  </td>
  <td>
   <font size='2'><?php echo $data["race"][$i];?>  </font>
  </td>
  <td>
   <font color='black' size='2'><?php echo $data["lvl"][$i];?></font>
  </td>
  <td>
   <font color='black' size='2'><?php echo $data["class"][$i];?></font>
  </td>
  <td>
   <font color=#777777 size='2'><?php echo $data["legion"][$i]; ?></font>
  </td>
  <td>
   <font color='black' size='2'><?php echo $data["location"][$i];?></font>
  </td>
 </tr>
<?php 
}//end for
?>
</table>
<br />
<font color='black' size='2'><b>Total:</b> <?php echo $count_online;?></font> 